package structurepattern.adapter;

public class MediaAdapter implements MediaPlayer {
	AdvancedMediaPlayer player;
	
	public MediaAdapter(String type) {
		if(type.equalsIgnoreCase("VLC")) {
			player = new VlcPlayer();
		}
		else if(type.equalsIgnoreCase("MP4")) {
			player = new Mp4Player();
		}
	}
	
	@Override
	public void play(String type, String fileName) {
		if(type.equalsIgnoreCase("VLC")) {
			player.playVlc(fileName);
		}
		else if(type.equalsIgnoreCase("MP4")) {
			player.playMp4(fileName);
		}
	}

}
